#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

class QGraphicsScene;
class QGraphicsView;
class QAction;
class QGraphicsItem;

class MainWindow : public QMainWindow
{
	Q_OBJECT

public:
	MainWindow(QWidget *parent = 0);
	~MainWindow();

public slots:
	void setDirty( bool on=true);

private slots:
	void newFile();

private:
	QGraphicsScene * mscene;
	QGraphicsView * mview;
	void createSceneAndView();

	void createMenuAndToolbar();

	void createAction();
	QAction * mactionQuit;
	QAction * mactionAdditem;
	QAction * maddRectitemac;
//	QAction * mDrawRectAction;

	void createConnection();

	void connectItem(QObject * item);

// overwrite methods;
protected:
	void closeEvent(QCloseEvent * event);
	void mousePressEvent(QMouseEvent *);
};

extern MainWindow *gMainWindow;

#endif // MAINWINDOW_H
